package com.sl.service;

import com.sl.mapper.CompanyCategoryMapper;
import com.sl.pojo.CompanyCategory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CompanyCategoryService  {
    @Resource
    private CompanyCategoryMapper companyCategoryMapper;

    ////查询：主键
    public CompanyCategory findByIdCompanyCategory(Integer id){
        return  companyCategoryMapper.selectByPrimaryKey(id);
    }
    //查询：所有
    public List<CompanyCategory> findAllCompanyCategory(){
        List<CompanyCategory> companyCategoryList = companyCategoryMapper.selectAll();
        return  companyCategoryList;
    }

    //增加
    public void addCompanyCategory(CompanyCategory companyCategory){
        companyCategoryMapper.insertSelective(companyCategory);
    }
    //修改
    public void updateCompanyCategory(CompanyCategory companyCategory){
        companyCategoryMapper.updateByPrimaryKeySelective(companyCategory);
    }

    public void deleteByIdCompanyCategory(CompanyCategory companyCategory) {
        companyCategoryMapper.deleteByPrimaryKey(companyCategory);
    }

}
